/* WebSocket演示页面样式 */

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  background-color: #f5f5f5;
}

h1, h2 {
  color: #2c3e50;
}

.container {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

/* 连接状态样式 */
#connection-status {
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: bold;
  display: inline-block;
  margin-bottom: 15px;
}

.connected {
  background-color: #d4edda;
  color: #155724;
}

.disconnected {
  background-color: #f8d7da;
  color: #721c24;
}

.reconnecting {
  background-color: #fff3cd;
  color: #856404;
}

.error {
  background-color: #f8d7da;
  color: #721c24;
}

/* 随机数显示区域 */
#random-numbers {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 10px;
  background-color: #f9f9f9;
}

.random-number {
  padding: 8px;
  margin: 5px 0;
  border-radius: 4px;
  background-color: #e3f2fd;
  border-left: 4px solid #2196f3;
  transition: all 0.3s ease;
}

.random-number:nth-child(odd) {
  background-color: #e8f5e9;
  border-left-color: #4caf50;
}

/* 消息区域 */
#messages {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 10px;
  margin-top: 15px;
  background-color: #f9f9f9;
}

.message {
  padding: 8px;
  margin: 5px 0;
  border-radius: 4px;
  background-color: #f1f1f1;
  border-left: 4px solid #9e9e9e;
}

/* 控制区域 */
.controls {
  margin: 20px 0;
}

button {
  background-color: #4caf50;
  color: white;
  border: none;
  padding: 10px 15px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #45a049;
}

input[type="number"] {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 80px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .container {
    padding: 15px;
  }
} 